﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;

namespace MvcApplication
{
    public class MyUnityContainer
    {
        private static IUnityContainer _current;
        private static readonly object syncLocker = new object();

        public static IUnityContainer Current
        {
            get
            {
                if (_current == null)
                {
                    lock (syncLocker)
                    {
                        if (_current == null)
                        {
                            _current = new UnityContainer();
                        }                       
                    }
                }
                return _current;
            }
        }
    }
}
